<template>
  <div>
    <input type="text" v-model="mes" @keydown.enter="input()" />
    <br />
    <br />
    <br />
    <p>正在进行</p>
    <Doing></Doing>
    <p>已经完成</p>
    <Finsh></Finsh>
  </div>
</template>
<script>
import Finsh from "@/components/Finsh";
import Doing from "@/components/Doing";
export default {
  name: "ToDoList",
  components: { Finsh, Doing },
  
  data() {
    return {
     mes: "",
      id: localStorage.getItem("id") || 1,
    }
  },
  methods:{
      input() {
        
        var obj={
            mes:this.mes,
            isFnish: false,
            id:this.id,
        }
      this.$store.commit("saveMessage", obj);
      console.log("按完成");
      this.id++;
       this.mes = "";
        localStorage.setItem("id",this.id);
    },
  },
  }

</script>
<style scoped>
</style>
